<%@page import="entities.Page"%>
<%@page import="java.util.TreeMap"%>
<%@page import="helpers.UrlHelper"%>
<%
TreeMap<String, String> check = (TreeMap<String, String>) request.getAttribute("check");
Page static_page = (Page) request.getAttribute("page");
String title = (String) request.getAttribute("title");
%>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/admin/layouts/header.jsp" />

<!-- elRTE Plugin -->
<script type="text/javascript" src="/admin/plugins/elrte/js/elrte.min.js"></script>
<link rel="stylesheet" href="/admin/plugins/elrte/css/elrte.css" media="screen" />

<script type="text/javascript" src="/admin/js/custom/static_page.js"></script>
<script type="text/javascript">
jQuery(document).ready(function () {
	var opts = {
			lang         : 'en',   // set your language
			styleWithCSS : false,
			height       : 400,
			toolbar      : 'maxi'
	};
	jQuery(".elrte").elrte(opts);
});

</script>
		
					<!-- Content Area -->
                	<div id="da-content-area">
                		<jsp:include page="/admin/elements/message_box.jsp" />
                        
                		<div class="grid_4">
                        	<div class="da-panel">
                            	<div class="da-panel-header">
                                	<span class="da-panel-title">
                                        <img src="/admin/images/icons/black/16/pencil.png" alt="" />
                                        <%=title %>
                                    </span>
                                    
                                </div>
                                <div class="da-panel-content">
                                	<form class="da-form" method="post">
                                    	<div class="da-form-inline">
                                    		<div class="da-form-row">
                                                <label>Title <span class="required">*</span></label>
                                                <div class="da-form-item">
                                                    <input type="text" name="title" value="<%=static_page.getTitle() %>" class="<%=check.get("title") != null ? "error" : "" %>"/>
                                                    <% if (check.get("title") != null) { %>
                                                    <span class="errorMessage"><%=check.get("title") %></span>
                                                    <% } %>
                                                </div>
                                            </div>
                                            
                                            <div class="da-form-row">
                                                <label>Content <span class="required">*</span></label>
                                                <div class="da-form-item large">
                                                    <textarea class="elrte" name="content" class="<%=check.get("content") != null ? "error" : "" %>"><%=static_page.getContent() %></textarea>
                                                    <% if (check.get("content") != null) { %>
                                                    <span class="errorMessage"><%=check.get("content") %></span>
                                                    <% } %>
                                                </div>
                                            </div>
                                            
                                            <div class="da-button-row">
                                            	<input type="submit" value="Submit" class="da-button blue left" />
	                                        	<input type="reset" value="Reset" class="da-button gray" />
	                                        </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                	</div>

<jsp:include page="/admin/layouts/footer.jsp" />